<?php

include_once 'BaseDAO.php';
include_once dirname(__FILE__) . '/../clases/PeerReview.php';

class PeerReviewDAO extends BaseDAO{
	
	function PeerReviewDAO($conexionBD) {
		parent::BaseDAO($conexionBD);
	}
	
	function llenarListPeerReviews(){
		$query = "SELECT * FROM latamdocs.peer_review";		
		$this->conexionBD->abrirConexion();
		$salida = mysqli_query($this->conexionBD->getConexion(),$query);
		if(!$salida){
			echo $mensajeError . " " .  mysqli_errno($this->conexionBD->getConexion()) ." ". mysqli_error($this->conexionBD->getConexion()) . "</br>";
		}
		echo 'POS';
		$this->conexionBD->cerrarConexion();
		$listPeerReviews = array();
		while($row = mysqli_fetch_array($salida)){
			$peerReview = new PeerReview();
			$peerReview->setId($row['ad_peer_review']);
			$peerReview->setNombre($row['nm_nombre_pr']);
			$peerReview->setPlantilla($row['nm_plantilla']);
			$peerReview->setPath($row['nm_ruta_plantilla']);
			array_push($listPeerReviews, $peerReview);
		}

		return $listPeerReviews;		
	} 	

}
